Skip to content

Allow selection of initial years to not require/read full range from MIN-MAX start years#248

Merged
andrewbaxter439 merged 3 commits into
developfrom
experimental/select-initial-years
Sep 23, 2025
Merged

Allow selection of initial years to not require/read full range from MIN-MAX start years#248
andrewbaxter439 merged 3 commits into
developfrom
experimental/select-initial-years

Conversation

@andrewbaxter439

Copy link
Copy Markdown
Collaborator

This is a potential fix for closing #229

What

  • adds option to specify initialYears in config file.
  • if set, reads initial population tables from these years only

Why

  • Quick way of saying "I only want these years" without editing MIN_START_YEAR and MAX_START_YEAR in Parameters.java
  • Only load populations of interest to save time/space, leave out bulky csv files from runs when not needed
  • should be ignored for training population?

How

In a configuration file, specify:

parameter_args:
  includeYears:
    - 2015
    - 2019
    - etc.

Check defaut.yml for range of potential sample years.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to selectively load initial population data for specific years instead of loading the full range defined by MIN_START_YEAR and MAX_START_YEAR parameters. This optimization aims to save time and memory when only certain years are needed for simulation.

  • Added includeYears parameter to allow selective year loading
  • Modified DataParser to support year-specific population initialization
  • Updated configuration file to include example usage of the new feature

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/main/java/simpaths/data/startingpop/DataParser.java Added new overloaded method and conditional logic to use includeYears when specified
src/main/java/simpaths/data/Parameters.java Added static field to store the includeYears configuration
config/default.yml Added commented example configuration for the includeYears parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/main/java/simpaths/data/Parameters.java
Comment thread src/main/java/simpaths/data/startingpop/DataParser.java Outdated
Comment thread src/main/java/simpaths/data/startingpop/DataParser.java
@andrewbaxter439 andrewbaxter439 self-assigned this Sep 23, 2025
@andrewbaxter439 andrewbaxter439 merged commit 1ae7e36 into develop Sep 23, 2025
5 checks passed
@andrewbaxter439 andrewbaxter439 deleted the experimental/select-initial-years branch January 6, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress need for MIN_START_YEAR and MAX_START_YEAR parameters to match supplied initial populations

2 participants